package co.yixiang.modules.shop.service.impl;

import co.yixiang.common.service.impl.BaseServiceImpl;
import co.yixiang.modules.shop.entity.YxSales;
import co.yixiang.modules.shop.mapper.YxSalesMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Slf4j
@Service
@Transactional(rollbackFor = Exception.class)
public class YxSalesServiceImpl extends BaseServiceImpl<YxSalesMapper,YxSales> implements co.yixiang.modules.shop.service.YxSalesService{


    @Autowired
    private YxSalesMapper yxSalesMapper;
    @Override
    public YxSales findByUserName(String username) {
        QueryWrapper<YxSales> wrapper=new QueryWrapper<>();
        wrapper.eq("username",username);
        return getOne(wrapper);
    }

    @Override
    public List<YxSales> getAll(){
        QueryWrapper<YxSales> wrapper=new QueryWrapper<>();
        wrapper.eq("group_id","1");
        return yxSalesMapper.selectList(wrapper);
    }
}
